package com.fjh.controller.bus;

import com.fjh.common.Result;
import com.fjh.service.ReturnService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 换车记录管理
 */
@RestController
@RequestMapping("/busrenturn")
public class ReturnController {

    @Autowired
    private ReturnService returnService;


    /**
     * 归还车辆
     *
     * @param rentId 租赁车辆记录的id
     * @return
     */
    @PostMapping("/return.do")
    public Result returnCar(Integer rentId) {

        Boolean isOk = returnService.returnCar(rentId);
        return isOk ? Result.ok() : Result.fail();

    }
}
